package com.example.spring.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class JDBCUtil {
    static Connection conn = null;
    static {

        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn= DriverManager.getConnection(
                    "jdbc:mysql://master:3306/student?useUnicode=true&characterEncoding=utf-8",
                    "root",
                    "123456");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    public static Connection getConn(){
        return conn;
    }
}
